import { http } from '@/utils/http.js'

// 解绑手机-QQ登录
export const putUnboundApi = (mobile) => {
  return http.request({
    method: 'PUT',
    url: '/unbound/' + mobile,
  })
}

/**
 * 绑定手机号
 */
export const bindingMobileApi = (data) => {
  return http.post('/login/binding', data)
}

/**
 * QQ登录
 */
export const QQLoginApi = (data) => {
  return http.post('/login/thirdparty', data)
}

// 详细信息
export const userDetailInfoApi = () => {
  return http.request({
    method: 'GET',
    url: '/patient/myUser',
  })
}

// 验证码登录
export const loginByMobileApi = (data) => {
  return http.request({
    method: 'POST',
    url: '/login',
    data,
  })
}

/**
 * 发送验证码
 */
export const verifyCodeApi = (data) => {
  // get 方法的参数需要通过 params 来传递
  return http.request({
    method: 'GET',
    url: '/code',
    params: data,
  })
}
